package com.yjb.demo.xxljob.job;

import com.xxl.job.core.handler.annotation.XxlJob;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * @author yinjinbiao
 * @create 2024/8/27 12:22
 */
@Slf4j
@Component
public class JobExample {


    @XxlJob("job1")
    public void job1(){
        log.info(Thread.currentThread().getName());
        log.info("job1");
    }

    @XxlJob("job2")
    public void job2() throws InterruptedException {
        log.info(Thread.currentThread().getName());
        Thread.sleep(30000);
        log.info("job2");
    }

    @XxlJob("job3")
    public void job3() throws InterruptedException {
        log.info(Thread.currentThread().getName());
        Thread.sleep(30000);
        log.info("job3");
    }

}
